<template>
	<view class="container">
		<view class="set_deposite">
			<view class="tab" :class="{active:isActive}">
				<text :class="navIndex==0?'on':''" @click="checkIndex(0)">购买ADC</text>
				<text :class="navIndex==1?'on':''" @click="checkIndex(1)">出售ADC</text>
			</view>
			<view v-show="navIndex==0">
				<CreateBuy></CreateBuy>
			</view>
			<view v-show="navIndex==1">
				<CreateSell></CreateSell>
			</view>
			
		</view>
		
	</view>
</template>

<script>
import CreateBuy from './creat_buy.vue'
import CreateSell from './create_sell.vue'
export default{
	components: {
	    //注册组件
		CreateBuy,CreateSell
	},
	data(){
		return{
			navIndex: 0,
			isActive: false,
		}
	},
	methods:{
		checkIndex(index) {
			console.log(index)
			this.navIndex = index;
			if(this.navIndex == 1){
				this.isActive = true
			}else{
				this.isActive = false
			}
		},
	}
}	
</script>

<style lang="scss">
@import url("../../common/style.scss");
@import url("create.scss");
</style>